package ca.etsmtl.log660.dao;

import java.util.List;

import ca.etsmtl.log660.entity.Client;
import ca.etsmtl.log660.entity.Film;
import ca.etsmtl.log660.entity.Location;

public class EntityFacade {

	public EntityFacade() {
	}
	
	public Client getClientById(Long clientId) {
		ClientDAO dao = new ClientDAO();
		return dao.getById(clientId);
	}
	
	public Client getUserByCredential(String email, String password) {
		Client loggedClient = null;
		
		ClientDAO dao = new ClientDAO();
		loggedClient = dao.getByCredential(email, password);
		
		return loggedClient;
	}
	
	public void saveLocation(Location loc) {
		LocationDAO dao = new LocationDAO();
		dao.saveLocation(loc);
	}
	
	
	public Film getFilmById(Long id) {
		FilmDAO dao = new FilmDAO();
		return dao.getById(id);
	}
	
	public List<Film> searchMovie(
			List<String> titlesFilters,
			String startYearFilter,
			String endYearFilter,
			List<String> prodCountriesFilters,
			List<String> langagesFilters,
			List<String> genresFilters,
			List<String> realisatorsFilters,
			List<String> actorsFilters
	) {
		FilmDAO dao = new FilmDAO();
		return dao.search(titlesFilters, startYearFilter, endYearFilter, prodCountriesFilters, langagesFilters, genresFilters, realisatorsFilters, actorsFilters);
	}
}
